const consoleColor = require('../index');

{
	// 默认颜色
	//use system console function，The system console maybe no color
	console.group('-----------demo1:use system console function-----------');
	consoleColor.info('info');
	consoleColor.debug('debug');
	consoleColor.warn('warn');
	consoleColor.error('error');
	consoleColor.info('hello', 'michael', 'ray');
	console.groupEnd();
}

{
	//change default color
	console.group('---------demo2:set default color------------');

	console.info('info', 'hello michael');
	console.warn('this is warn');
	console.error('this is error');
	console.debug('this is debug');
	console.log('this is log', 'msg1'.red, 'msg2'.blue);
	console.info('this is info', 'msg1'.red, 'msg2'.blue); //force change default color

	console.groupEnd();
}

{
	console.group('---------variable use color------------');

	let name = 'Michael';
	let age = 1000;

	let obj = {
		name: 'michael',
		age: '100'
	};

	function hello() {
		return 'hello';
	}

	function isBoole() {
		return true;
	}

	console.log(name);
	console.log('Hello,My name is ' + name.green + ',I am a' + ' man'.yellow + '.');
	console.log(age.blue);
	console.log(obj.name.blue);
	console.log(obj.name.greenBG);
	console.log(hello().red);
	//Boolean value must change to string.
	console.log(isBoole().toString().red);

	console.groupEnd();
}
